import std.stdio;
import core.thread;
import std.datetime;
import core.memory;

void main()
{
    int size  = 1024 * 1024 * 30;
     {
       // void * pp = GC.malloc(size);
        ubyte[] hh = new ubyte[size];// cast(ubyte[])(pp[0..size]);//
        hh[198] = 0xff;
        hh[199] = 0xff;
        hh[200] = 0xff;
        auto tt = hh[200..$];
        writeln("start sleep!");
        Thread.sleep( dur!("seconds")( 10) ); // sleep for 5 seconds
        writeln("free tt!");
        GC.free(hh.ptr);
        writeln("free over!");
     }
    Thread.sleep( dur!("seconds")( 20) ); // sleep for 5 seconds
    
    GC.collect();
    writeln("GC collet");
    Thread.sleep( dur!("seconds")( 20) ); // sleep for 5 seconds
    writeln("exec over");
}
